home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 176-200 / scopedisk180 / rxmenu2 / arexxmenu.rexx < prev    next >
OS/2 REXX Batch file  |  1995-03-19  |  6KB  |  198 lines

  1. /*****************************************************************/
  2. /* ArexxMenu.rexx - Intuition based menu system for Amiga with    */
  3. /* AREXX and Dissidents Software Rx_Intui.library.            */
  4. /*                                                    */
  5. /* Uses RunF1.rexx and Exec1.rexx macros to provide a simple    */
  6. /* facility for auto-running programs through the use of the    */
  7. /* FileIO file requestor and the RunF1 and Exec1 macros.        */
  8. /* RunF provides a CLI for running programs without .info files.    */
  9. /* This program checks for the .info file, if present then         */
  10. /* program runs in background.  If the .info file is absent,    */
  11. /* then RunF1 is used to provide a CLI for output.            */
  12. /*                                                    */
  13. /* © 1990 by Steven D. Kapplin                            */
  14. /* Version 1.0 - 11/11/90                                */
  15. /*****************************************************************/
  16.  
  17. parse arg xpos ypos width height .
  18.  
  19. if xpos = "?" then do
  20.     say "SYNTAX:  FastMenu1 <xpos> <ypos> <wid> <ht>"
  21.     say "    xpos = x offset for window  (default = 0)"
  22.     say "    ypos = y offset for window  (default = 150)"
  23.     say "    wid  = window width (min = 240, default = 240)"
  24.     say "    ht   = window height (min = 10, default = 10)"
  25.     exit 0
  26. end
  27.  
  28. if width = "" | width < 240 then width = 240
  29. if height = "" | height < 10 then height = 10
  30. if xpos ="" then xpos = 150
  31. if ypos ="" then ypos = 0
  32.  
  33. if ~exists('libs:rx_intui.library') then do
  34.     say 'rx_intui.library not in Libs: ... Aborting'
  35.     exit 10
  36. end
  37.  
  38. if ~exists('libs:rexxsupport.library') then do
  39.     say 'RexxSupport.library not in Libs: ... Aborting'
  40.     exit 10
  41. end
  42.  
  43. if ~show('L','rx_intui.library') then
  44.    call addlib('rx_intui.library',0,-30)
  45.  
  46. if ~show('L','rexxsupport.library') then
  47.    call addlib('rexxsupport.library',0,-30)
  48.  
  49. wind=GetWindow(center('ARexx Menu',25),,xpos,ypos,width,height,,,4618)
  50.  
  51. IF wind == '' | wind == 0 THEN do
  52.     SAY 'Window open error'
  53.     exit 10
  54. END
  55.  
  56.  
  57. menu = AddMenu(wind,'Tools',0,90)
  58.     item = AddItem(menu,'New WShell','2',,,'W',wind)
  59.     item = AddItem(menu,'Editors',,,,,wind)
  60.         sub = AddSub(item,'Edit E','2',,,'E',wind)
  61.         sub = AddSub(item,'Edit CED','2',,,'C',wind)
  62.     item = AddItem(menu,'Print File','2',,,'P',wind)
  63.     item = AddItem(menu,'Disk Tools',,,,,wind)
  64.         sub = AddSub(item,'Dir Util',,,,,wind)
  65.         sub = AddSub(item,'Clean VD0:',,,,,wind)
  66.         sub = AddSub(item,'NewZap','2',,,'Z',wind)
  67.         sub = AddSub(item,'DC KF0:','2',,,'K',wind)
  68.     item = AddItem(menu,'GOMF',,,,,wind)
  69.         sub = AddSub(item,'Nuke',,,,,wind)
  70.         sub = AddSub(item,'Recall',,,,,wind)
  71.     item = AddItem(menu,'Flicker On/Off','03',,,,wind)
  72.     item = AddItem(menu,'Quit','2',,128+1,'Q',wind)
  73.  
  74. menu = AddMenu(wind,'DeskTop',100,90)
  75.     item = AddItem(menu,'Card Index','2',,,'A',wind)
  76.     item = AddItem(menu,'Calendar','2',,,'D',wind)
  77.     item = AddItem(menu,'Rollodex','2',,,'R',wind)
  78.     item = AddItem(menu,'Note Pad','2',,,'N',wind)
  79.     item = AddItem(menu,'Calculators',,,,,wind)
  80.         sub = AddSub(item,'Programmer',,,,,wind)
  81.         sub = AddSub(item,'Financial',,,,,wind)
  82.         sub = AddSub(item,'Scientific',,,,,wind)
  83.  
  84. menu = AddMenu(wind,'Applications',200,100)
  85.     item = AddItem(menu,'Terminal',,,,,wind)
  86.     item = AddItem(menu,'WordProcess',,,,,wind)
  87.         sub = AddSub(item,'ProWrite',,,,,wind)
  88.         sub = AddSub(item,'Excellence',,,,,wind)
  89.     item = AddItem(menu,'Spreadsheet',,,,,wind)
  90.     item = AddItem(menu,'Data Base',,,,,wind)
  91.     item = AddItem(menu,'Paint',,,,,wind)
  92.     item = AddItem(menu,'CanDo',,,,,wind)
  93.  
  94.  menu = AddMenu(wind,'Devices',350,90)
  95.     item = AddItem(menu,'AutoExec',,,,,wind)
  96.  
  97. /* Loop until CLOSEWINDOW class (0), printing out all IDCMPspecs in the upper */
  98. /* left corner. Note that the Quit Item will return a MENUPICK and then a CLOSEWINDOW. */
  99. /* Observe the printout as you select and use gadgets and click the mouse. */
  100. /* Start out CLASS = 1 before we get into the loop. */
  101. class = 1
  102. DO WHILE class > 0
  103.     spec=WaitMsg(wind)
  104.     PARSE var spec class menu item subitem
  105.     IF class = 2 then do
  106.         SELECT
  107.             WHEN menu = 0 then do
  108.                 IF item = 0 then 'newwsh con:0/11/540/120/NewShell/c'
  109.                 IF item = 1 & subitem = 0 then 'runwsh sys:Tools/E'
  110.                 IF item = 1 & subitem = 1 then 'sys:CEdit'
  111.                 IF item = 2 then 'runwsh sys:printutils/GWPrint'
  112.                 IF item = 3 & subitem = 0 then 'runwsh sys:Utilities/PowerPlatform'
  113.                 IF item = 3 & subitem = 1 then 'sys:System/DiskUtils/CleanRamDisk'
  114.                 IF item = 3 & subitem = 2 then 'runwsh sys:System/DiskUtils/Zap'
  115.                 IF item = 3 & subitem = 3 then 'DiskChange KF0:'
  116.                 IF item = 4 & subitem = 0 then 'sys:System/Nuke'
  117.                 IF item = 4 & subitem = 1 then 'sys:System/Recall'
  118.                 IF item = 5 then 'runwsh c:AntiFlicker -c'
  119.             END
  120.             WHEN menu = 1 then do
  121.                 IF item = 0 then 'runwsh sys:BigC/AmigaDex'
  122.                 IF item = 1 then do
  123.                     'cd sys:DeskTop/Organizers'
  124.                     'runwsh sys:DeskTop/Organizers/Calendar'
  125.                 END
  126.                 IF item = 2 then do
  127.                     'cd sys:DeskTop/Organizers'
  128.                     'runwsh sys:DeskTop/Organizers/APB'
  129.                 END
  130.                 IF item = 3 then 'runwsh sys:BigC/MemoPad'
  131.                 IF item = 4 & subitem = 0 then 'runwsh sys:DeskTop/Calculators/Programmer'
  132.                 IF item = 4 & subitem = 1 then 'runwsh sys:DeskTop/Calculators/Financial'
  133.                 IF item = 4 & subitem = 2 then 'runwsh sys:DeskTop/Calculators/Scientific'
  134.             END
  135.             WHEN menu = 2 then do
  136.                 IF item = 0 then do
  137.                     'cd Online!:'
  138.                     'runwsh Online!:Online!'
  139.                 END
  140.                 IF item = 1 & subitem = 0 then do
  141.                     'cd ProWrite:'
  142.                     'runwsh ProWrite:ProWrite'
  143.                 END
  144.                 IF item = 1 & subitem = 1 then do
  145.                     'cd Excellence!:'
  146.                     'runwsh Excellence!:Excellence!'
  147.                 END
  148.                 IF item = 2 then do
  149.                     'cd Advantage:'
  150.                     'runwsh Advantage:Advantage -w'
  151.                 END
  152.                 IF item = 3 then do
  153.                     'cd Filer:'
  154.                     'runwsh Filer:FileIIsg'
  155.                 END
  156.                 IF item = 4 then do
  157.                     'cd Dpaint:'
  158.                     'runwsh Dpaint:Dpaint'
  159.                 END
  160.                 IF item = 5 then do
  161.                     'cd CanDo:'
  162.                     'runwsh CanDo:CanDo'
  163.                 END
  164.             END
  165.             WHEN menu = 3 then do
  166.                 cdir = pragma('D')
  167.                 call FileReq(wind,cdir)
  168.                 if path = '' then iterate
  169.                 'Exec1 'path' 'wind''
  170.             END    
  171.             OTHERWISE
  172.         END
  173.     END
  174. END
  175.  
  176. err=EndWindow(wind)
  177.  
  178. exit
  179.  
  180.  
  181. FileReq: procedure expose path
  182.     arg wind,cdir
  183.     err = MoveView(wind,6,90,240)
  184.     call delay(25)
  185.     fileio = GetFIO()
  186.     path = FioNW(fileio,'Choose File',128,,cdir,,,wind,20,20)
  187.     if ~exists(path) then do
  188.         path = ''
  189.         err = MoveView(wind,5,,)
  190.         err = Text("File Not Found",wind,5,30)
  191.         call delay(100)
  192.     end
  193.     err = EndFIO(fileio)
  194.     call delay(25)
  195.     err = MoveView(wind,6,-90,-240)
  196. RETURN
  197.  
  198.